{% extends "base.html" %}

{% block extra_head %}
    
    
{% end %}

{% block content %}

    <!-- 博客正文 -->
    <div class="container" style="margin-bottom:50px">
        <h2 class="text-center">{{ blog['title'] }}</h2>
        <div class="row">
            <p class="text-center ">
                <span class="label label-default"> 
                {{ _("作者") }}：{{ blog['author'] }} &emsp; 
                {{ _("发布时间") }} ：{{ locale.format_date(blog['date']) }} 
                </span>
            </p>
        </div>
        <hr>
        <div class="container " id = "mdcontainer">
            {% raw blog['texthtml'] %}
        </div>
    </div>
    <hr>
    <!-- 评论列表  -->
    <div class="container" style="margin-bottom:20px;">
        <ul class="list-unstyled">
            {% for comment in comment_list %}
            <li class="col-xs-11 col-xs-offset-1">
                <div class="panel panel-default">
                    <div class="panel-body">
                      <div class="media">
                          <div class="media-left">
                              <a class="pull-left" href="">
                                <img class="media-object img-circle" src="{{ static_url('img/scenery-48.ico') }}" />
                              </a>                      
                          </div>
                          <div class="media-body">
                            <div class="media">
                              {{ comment['text'] }}
                            </div>
                          </div>
                      </div>
                    </div> 
                    <div class="panel-footer text-right">
                        <small><span>{{ comment['author'] }}</span>
                        <span>{{ comment['date'] }}</span>
                        </small>
                    </div>
                </div>
            </li>
            {% end %}
        </ul>
    </div>    
    <hr>
    <!-- 评论form -->
    <h5>发表评论</h5>
    <div class="container">
        <form class="" method="post" action="/comment" class="form" >
            {% raw xsrf_form_html() %}
            <input type="hidden" name="blogid" value="{{ str(blog['_id']) }}" />
            <div class="form-group">                
                <textarea rows="" cols="" name="comment"></textarea>
            </div>
            <div class="form-group">
                <div class="">
                    <input type="submit" name="submit" id="submit" class="btn btn-primary" value="发表评论" />
                </div>
            </div>
        </form>
    </div>
{% end %}
